// MIMEMail.h: interface for the CMIMEMail class.
//
//////////////////////////////////////////////////////////////////////

#ifndef _SEMAILLIB_MIMEEMAIL_H
#define _SEMAILLIB_MIMEEMAIL_H

#include "Email.h"

class CMIMEMail : public CEmail  
{
public:

	class Attachment
	{
	public:
		std::string Path;
		std::string Name;
		std::string ContentType;
		std::string Description;

		bool IsEmpty(){
			return Path.empty();
		}
	};

	virtual bool GetFirstAttach(std::string & data);
	virtual bool GetCurAttach(std::string & data);
	virtual bool GetNextAttach(std::string & data);
	virtual std::string GetContent();
	virtual void GetData(std::string& data);

	std::string GetCharset();
	void SetCharset(const std::string & charset);
	
	void AddAttach(const std::string & path, const std::string& name = "", 
					const std::string& type = "", const std::string&  description = "");
	void SetAttach(const std::string& attach);
	std::string GetBoundary();
	void SetBoundary(const std::string& boundary);
	CMIMEMail();
	virtual ~CMIMEMail();

protected:
	virtual void GenerateHeader();

private:
	
	std::string m_strCharset;
	std::string m_strBoundary;

	std::vector< Attachment > m_vAttachList;
	unsigned int	m_nCurAttach;
};

#endif